package shop.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import shop.dao.IOrdersDao;
import shop.model.dto.OrdersDTO;
import shop.model.vo.OrdersVO;

@RestController
@RequestMapping("orders")
public class OrdersController {

	@Resource
	private IOrdersDao dao;
	
	@RequestMapping("findOrdersByUId.do")
	public Map findOrdersByUId(OrdersDTO dto) {
		List<OrdersVO> list = dao.findOrdersByUId(dto);
		Map map = new HashMap();
		map.put("code", "0");
		map.put("msg", "");
		map.put("count", list.size());
		map.put("data", list);
		return map;
	}
}
